import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/login.vue'
import Layout from '@/views/layout.vue'
import Table from '@/views/table.vue'
import Tree from '@/views/tree.vue'
import Form from '@/views/form.vue'
Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      path: '/login',
      component: Login
    },
    {
      path: '/', // 主页
      component: Layout,
      children: [
        // {
        //   path: '/',
        //   redirect:'/table'
        // },
        // 表格: http://localhost:808/#/table
        // tree: http://localhost:808/#/tree
        { 
          path: '', // path为''， 默认显示的内容
          component: Table
        },
        { 
          path: 'tree',
          component: Tree
        },
        { 
          path: 'form',
          component: Form
        }
      ]
    }
  ]
})

export default router